import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/user_drama_log_list_entity.dart';

UserDramaLogListEntity $UserDramaLogListEntityFromJson(
    Map<String, dynamic> json) {
  final UserDramaLogListEntity userDramaLogListEntity = UserDramaLogListEntity();
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    userDramaLogListEntity.title = title;
  }
  final String? dramaName = jsonConvert.convert<String>(json['drama_name']);
  if (dramaName != null) {
    userDramaLogListEntity.dramaName = dramaName;
  }
  final int? money = jsonConvert.convert<int>(json['money']);
  if (money != null) {
    userDramaLogListEntity.money = money;
  }
  final int? giveMoney = jsonConvert.convert<int>(json['give_money']);
  if (giveMoney != null) {
    userDramaLogListEntity.giveMoney = giveMoney;
  }
  final int? buyTime = jsonConvert.convert<int>(json['buy_time']);
  if (buyTime != null) {
    userDramaLogListEntity.buyTime = buyTime;
  }
  return userDramaLogListEntity;
}

Map<String, dynamic> $UserDramaLogListEntityToJson(
    UserDramaLogListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['title'] = entity.title;
  data['drama_name'] = entity.dramaName;
  data['money'] = entity.money;
  data['give_money'] = entity.giveMoney;
  data['buy_time'] = entity.buyTime;
  return data;
}

extension UserDramaLogListEntityExtension on UserDramaLogListEntity {
  UserDramaLogListEntity copyWith({
    String? title,
    String? dramaName,
    int? money,
    int? giveMoney,
    int? buyTime,
  }) {
    return UserDramaLogListEntity()
      ..title = title ?? this.title
      ..dramaName = dramaName ?? this.dramaName
      ..money = money ?? this.money
      ..giveMoney = giveMoney ?? this.giveMoney
      ..buyTime = buyTime ?? this.buyTime;
  }
}